﻿using Application.AppService.CPCAppService;
using AutoMapper;
using Domain.Entity;
using Microsoft.AspNetCore.Mvc;

namespace UI.Controllers.Customization_Settings_客户化设置_.Human_resource_file_management_人力资源档案管理_
{
    public class CPCController : Controller
    {
        private readonly ICPCAppService cPCAppService;
        private readonly IMapper mapper;

        public CPCController(ICPCAppService cPCAppService, IMapper mapper)
        {
            this.cPCAppService = cPCAppService;
            this.mapper = mapper;
        }
        public IActionResult Index()
        {
            return View();
        }

        [HttpGet("GetCPCAttributeKind")]
        public async Task<IActionResult> GetCPCAttributeKind()
        {
            List<CPC> cpc = await cPCAppService.GetCPCAttributeKindAsync("职称");
            return Json(cpc);
        }

        [HttpPost("DeleteCPC")]
        public async Task<IActionResult> DeleteCPC(int id)
        {
            bool i = await cPCAppService.DeleteCPCAsync(id);
            return Json(i);
        }
    }
}
